package com.example.designpattern.duckexample;

import com.example.designpattern.duckexample.behavior.Flyable;
import com.example.designpattern.duckexample.behavior.Quackable;


public abstract class Duck{

	private String name;
	private Flyable flyable;
	private Quackable quackable;

	public Duck() {
		System.out.println("Initial Duck");
	}
	
	public Duck(String name) {
		System.out.println("Initial Duck: " + name);
	}
	
	public void performFly() {
		flyable.fly();
	}
	public void performQuack() {
		quackable.quack();
	}
	
	//GETTER & SETTER
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Flyable getFlyable() {
		return flyable;
	}
	public Quackable getQuackable() {
		return quackable;
	}
	public void setFlyable(Flyable flyable) {
		this.flyable = flyable;
	}
	public void setQuackable(Quackable quackable) {
		this.quackable = quackable;
	}
}
